﻿using UnityEngine;
using System.Collections;

public class Objective : MonoBehaviour {

	public bool isObjective;

	GameManager _gameManager;
	
	// Use this for initialization
	protected void Start () {
		_gameManager = GameObject.FindGameObjectWithTag ("GameManager").GetComponent<GameManager>();
	}
	
	// Update is called once per frame
	void Update () {
	
	}

	protected void Completed() {
		if (isObjective) {
			++_gameManager.completedObjectives;
		}
	}

	void OnDestroy() {
		if (isObjective) {
			++_gameManager.completedObjectives;
		}
	}
}
